import React, { useRef, useEffect, forwardRef } from 'react'
import { useGLTF, useAnimations } from '@react-three/drei'
import selectMesh from '../../proxy/selectMesh';

const people = forwardRef((props, ref) => {
  const { nodes, materials, animations } = useGLTF('/models/people.glb')
  const { actions } = useAnimations(animations, ref)
  useEffect(() => {
    for (const k in actions) {
      actions[k].play()
    }
  }, [actions]);
  return (
    <group ref={ref} scale={1} dispose={null} position={[-6.3, -0.8, -2]} visible={false}>
      <group scale={0.003} rotation={[0, 4, 0]}>
        <mesh name={"peopleMeshMater"} geometry={nodes.mesh_id30.geometry} material={materials.材质} rotation={[-0.019385, 0.120007, 0.007626]} scale={[28.845873, 28.845879, 28.845875]} >
          <meshBasicMaterial
            color={'#e01616'}
            opacity={1}
            transparent
          />
        </mesh>
      </group>
    </group >
  )
})

useGLTF.preload('/models/people.glb')

export default people;
